package com.doit.day01;

import java.sql.SQLException;
import java.util.Iterator;

/**
 * 先讲读文件这个测试写一下
 *
 * 写一个迭代器，一次从数据库中的一张表里面读取一行数据，封装成一个对象返回
 *
 */
public class _02_迭代器测试 {
    public static void main(String[] args) throws SQLException {
        /*MyIterator myIterator = new MyIterator();
        while (myIterator.hasNext()){
            System.out.println(myIterator.next());
        }*/
       /* MysqlIterator mysqlIterator = new MysqlIterator();
        while (mysqlIterator.hasNext()){
            System.out.println(mysqlIterator.next());
        }*/
        MyIterable userInfos = new MyIterable();
        /*Iterator<UserInfo> iterator = userInfos.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }*/
        for (UserInfo userInfo : userInfos) {
            System.out.println(userInfo);
        }

    }
}
